package com.fenghongzhang.kotlin5.day04

import android.util.Log

/**
 * 单例类
 */
object LogUtil{


    const val VERBOSE = 0
    const val DEBUG = 1
    const val INFO = 2
    const val WRRN = 3
    const val ERROR = 4

    var level = VERBOSE

    fun v(tag:String,msg:String){
        if(level <= VERBOSE){
            Log.v(tag,msg)
        }
    }

    fun d(tag:String,msg:String){
        if(level <= DEBUG){
            Log.d(tag,msg)
        }
    }

    fun i(tag:String,msg:String){
        if(level <= INFO){
            Log.i(tag,msg)
        }
    }
    fun w(tag:String,msg:String){
        if(level <= WRRN){
            Log.w(tag,msg)
        }
    }
    fun e(tag:String,msg:String){
        if(level <= ERROR){
            Log.e(tag,msg)
        }
    }

}